import 'dart:ui';

import 'package:sml_policies/language/language.dart';

class SmlPoliciesConfig {

  SmlPoliciesConfig({
    Color? mainColor,
    String? language,
    required this.logEvent,
    String? permissionUrl,
    String? privacyUrl,
    required this.onToast,
  }) : mainColor = mainColor ?? const Color(0xff1577FF),
    language = language ?? 'en',
    permissionUrl = permissionUrl ?? "http://testmexico-smartloan-3003.gccloud.xyz/#/pd_pop",
    privacyUrl = privacyUrl ?? "http://testmexico-smartloan-3003.gccloud.xyz/#/provicy";

  Color mainColor;
  String language;
  String permissionUrl;
  String privacyUrl;

  Function(String msg) logEvent;
  Function(String toast) onToast;
  Function? onPermissionAgree = () {};

  Map get languageMap {
    if (language == 'en') {
      return Language.en;
    } else {
      return Language.es;
    }
  }

  set setPermissionUrl(String value) => permissionUrl = value;
  set setPrivacyUrl(String value) => privacyUrl = value;

}